<?php
include_once '/var/www/html/new/com.inc.php';
$pathname = "upload/{$_SESSION['account']}";
$savePath = "/var/www/html/new/d/$pathname/";
$savePicName = "avatar_{$_SERVER['REQUEST_TIME']}";  //图片存储名称

if(!file_exists($savePath)) mkdir($savePath);
$file_src    = $savePath.$savePicName."_src.jpg";
$filename162 = $savePath.$savePicName."_162.jpg";

//print_r($_POST);
//exit;

$src=base64_decode($_POST['pic']);
$pic1=base64_decode($_POST['pic1']);

if($src) {
    file_put_contents($file_src,$src);
}
    file_put_contents($filename162,$pic1);
//echo $filename162;
//exit;
$rs['status'] = 1;

$rs['picUrl'] = "http://www.12301.cc/{$pathname}/{$savePicName}_162.jpg";


$sel = "UPDATE pft_member set headphoto='{$rs['picUrl']}' where id={$_SESSION['memberID']} LIMIT 1";
$GLOBALS['le']->query($sel);
echo json_encode($rs);

?>
